/* GUI CONVERTED from rmpmrp01.p (converter v1.76) Tue May 13 01:33:37 2003 */
/* rmpmrp01.p - CUSTOMER MASTER REPORT                                        */
/* Copyright 1986-2003 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.24 $                                                      */
/*V8:ConvertMode=FullGUIReport                                                */
/* REVISION: 1.0      LAST MODIFIED: 09/16/86   BY: PML  13                   */
/* REVISION: 6.0      LAST MODIFIED: 03/08/90   BY: pml *D001*                */
/* REVISION: 6.0      LAST MODIFIED: 12/13/90   BY: dld *D257*                */
/* REVISION: 6.0      LAST MODIFIED: 07/16/91   BY: afs *D776*                */
/* REVISION: 7.0      LAST MODIFIED: 11/22/91   BY: afs *F056*                */
/* REVISION: 7.4      LAST MODIFIED: 08/25/93   BY: tjs *H082*                */
/* REVISION: 7.4      LAST MODIFIED: 10/15/93   BY: jjs *H181*                */
/* REVISION: 7.4      LAST MODIFIED: 10/18/93   BY: cdt *H086*                */
/* REVISION: 7.4      LAST MODIFIED: 11/30/93   BY: tjs *H081*                */
/*           7.2                     08/30/94   BY: bcm *FQ43*                */
/* REVISION: 8.5      LAST MODIFIED: 07/07/95   BY: cdt *J057*                */
/* REVISION: 8.5      LAST MODIFIED: 11/01/96   BY: *H0NT* Suresh Nayak       */
/* REVISION: 8.6      LAST MODIFIED: 03/17/97   BY: *K07Z* Arul Victoria      */
/* REVISION: 8.6      LAST MODIFIED: 10/16/97   BY: gyk *K12B*                */
/* REVISION: 8.6      LAST MODIFIED: 10/29/97   BY: *H1G4* Manish K.          */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane          */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 9.0      LAST MODIFIED: 11/21/98   BY: *J353* Reetu Kapoor       */
/* REVISION: 9.0      LAST MODIFIED: 03/10/99   BY: *M0B3* Michael Amaladhas  */
/* REVISION: 9.0      LAST MODIFIED: 03/13/99   BY: *M0BD* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 10/01/99   BY: *N014* Robin McCarthy     */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane   */
/* REVISION: 9.1      LAST MODIFIED: 05/12/00   BY: *N09X* Antony Babu        */
/* REVISION: 9.1      LAST MODIFIED: 08/11/00   BY: *N0KK* jyn                */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* Revision: 1.21     BY: Katie Hilbert         DATE: 04/01/01  ECO: *P002*   */
/* Revision: 1.22     BY: Hualin Zhong          DATE: 10/25/01  ECO: *P010*   */
/* Revision: 1.23     BY: Ed van de Gevel       DATE: 11/05/01  ECO: *N15L*  */
/* $Revision: 1.24 $    BY: Narathip W.           DATE: 05/03/03  ECO: *P0R5*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/


/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "2+ "}
{cxcustom.i "rmpmrp01.P"}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE rmpmrp01_p_7 "Slspsn[1]"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

define variable code like pm_addr.
define variable code1 like pm_addr.
define variable name like ad_name.
define variable name1 like ad_name.
define variable zip like ad_zip.
define variable zip1 like ad_zip.
define variable type like pm_type.
define variable type1 like pm_type.
define variable region like pm_region.
define variable region1 like pm_region.
define variable slspsn like sp_addr.
define variable slspsn1 like slspsn.
define variable under as character format "x(78)".
define variable bk_acct_type like csbd_type.
{&rmpmrp01-P-TAG1}
define variable bk_acct_type_desc like glt_desc.

{&rmpmrp01-P-TAG2}

/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
code           colon 15
   code1          label {t001.i} colon 49 skip
   name           colon 15
   name1          label {t001.i} colon 49 skip
   zip            colon 15
   zip1           label {t001.i} colon 49 skip
   type           colon 15
   type1          label {t001.i} colon 49 skip
   region         colon 15
   region1        label {t001.i} colon 49 skip
   slspsn         colon 15
   slspsn1        label {t001.i} colon 49 skip
 SKIP(.4)  /*GUI*/
with frame a side-labels          width 80 NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME


{&rmpmrp01-P-TAG3}

/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

FORM /*GUI*/ 
   csbd_bank
   bk_acct_type
   csbd_edi
   csbd_branch
   csbd_bk_acct format "x(24)"
   csbd_beg_date
   csbd_end_date
with STREAM-IO /*GUI*/  down frame csbd width 88
   title color normal (getFrameTitle("BANK_ACCOUNTS_DATA",26)).

/* SET EXTERNAL LABELS */
setFrameLabels(frame csbd:handle).

under = caps(dynamic-function('getTermLabelFillCentered' in h-label,
   input "CUSTOMER_ADDRESS",
   input 78,
   input "=")).

{wbrp01.i}

/*GUI*/ {mfguirpa.i true "printer" 80 " " " " " "  }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:

   if code1 = hi_char then code1 = "".
   if name1 = hi_char then name1 = "".
   if type1 = hi_char then type1 = "".
   if zip1 = hi_char then zip1 = "".
   if region1 = hi_char then region1 = "".
   if slspsn1 = hi_char then slspsn1 = "".

   if c-application-mode <> 'web' then
   {&rmpmrp01-P-TAG4}
   
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


   {wbrp06.i &command = update &fields = "  code code1 name name1 zip
        zip1 type type1 region region1 slspsn slspsn1" &frm = "a"}

   {&rmpmrp01-P-TAG5}
   if (c-application-mode <> 'web') or
      (c-application-mode = 'web' and
      (c-web-request begins 'data')) then do:

      bcdparm = "".
      {mfquoter.i code      }
      {mfquoter.i code1     }
      {mfquoter.i name      }
      {mfquoter.i name1     }
      {mfquoter.i zip       }
      {mfquoter.i zip1      }
      {mfquoter.i type      }
      {mfquoter.i type1     }
      {mfquoter.i region    }
      {mfquoter.i region1   }
      {mfquoter.i slspsn    }
      {mfquoter.i slspsn1   }

      {&rmpmrp01-P-TAG6}
      if code1 = "" then code1 = hi_char.
      if name1 = "" then name1 = hi_char.
      if type1 = "" then type1 = hi_char.
      if zip1 = "" then zip1 = hi_char.
      if region1 = "" then region1 = hi_char.
      if slspsn1 = "" then slspsn1 = hi_char.

   end.

   /* OUTPUT DESTINATION SELECTION */
   
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i "printer" 80 " " " " " " " " }
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:




   {mfphead2.i}

   for each pm_mstr
         where (pm_addr >= code and pm_addr <= code1)
         and (pm_sort >= name and pm_sort <= name1)
         and (pm_type >= type and pm_type <= type1)
         and (pm_region >= region and pm_region <= region1)
         and (pm_slspsn[1] >= slspsn and pm_slspsn[1] <= slspsn1)
      no-lock by pm_sort:

      find ad_mstr where ad_addr = pm_addr no-lock.
      if (ad_zip >= zip and ad_zip <= zip1) then do:
  
         /* DISPLAY SELECTION FORM */
         {&rmpmrp01-P-TAG7}
         FORM /*GUI*/ 
            skip
            pm_addr        colon 16
            ad_name        colon 16
            ad_line1       colon 16
            ad_line2       colon 16
            ad_line3       colon 16
            ad_city        colon 16
            ad_state
            ad_zip         colon 62
            ad_country     colon 16
            ad_ctry  colon 48 no-label
            ad_county      colon 62
            ad_attn        colon 16
            ad_attn2       label "[2]" colon 49
            ad_phone       colon 16
            ad_ext
            ad_phone2      label "[2]" colon 49
            ad_ext2
            ad_fax         colon 16
            ad_fax2        label "[2]" colon 49
            ad_date
         with STREAM-IO /*GUI*/  frame a1 title color normal under side-labels width 88
            attr-space.
         {&rmpmrp01-P-TAG8}

         /* SET EXTERNAL LABELS */
         setFrameLabels(frame a1:handle).

         FORM /*GUI*/ 
            pm_sort        colon 16
            pm_type        colon 56
            pm_taxable     colon 76
            pm_taxc        no-label
            pm_slspsn[1]   colon 16 label {&rmpmrp01_p_7}
            pm_slspsn[2]   colon 34 label "[2]"
            pm_region      colon 56
            pm_pr_list2    colon 76

            pm_shipvia     colon 16
            pm_curr        colon 56
            pm_pr_list     colon 76

            pm_ar_acct     colon 16
            pm_ar_sub      no-label
            pm_ar_cc       no-label
            pm_lang        colon 56
            pm_fix_pr      colon 76

            pm_resale      colon 16
            pm_site        colon 56
            pm_class       colon 76

            pm_sic         colon 16
            pm_partial     colon 56

            pm_rmks        colon 16
         with STREAM-IO /*GUI*/  frame b title color normal
            (getFrameTitle("PRECUSTOMER_DATA",20)) side-labels
            width 88
            attr-space.

         /* SET EXTERNAL LABELS */
         setFrameLabels(frame b:handle).
/*fdn 2004/12/24 ****************************************************************begin*
         FORM /*GUI*/ 
            pm_cr_limit    colon 15
            pm_disc_pct    colon 41
            pm_bill        colon 61

            pm_cr_terms    colon 15
            pm_fin         colon 41
            pm_high_cr     colon 61

            pm_cr_hold     colon 15
            pm_stmt        colon 41
            pm_high_date   colon 61

            pm_cr_rating   colon 15
            pm_stmt_cyc    colon 41
            pm_sale_date   colon 61

            pm_db          colon 15
            pm_dun         colon 41
            pm_pay_date    colon 61

            pm_po_req      colon 15
            pm_cr_review   colon 61
            pm_cr_update   colon 61
         with STREAM-IO /*GUI*/  frame c title color normal
            (getFrameTitle("CUSTOMER_CREDIT_DATA",29)) side-labels
            width 88
            attr-space.

         /* SET EXTERNAL LABELS */
         setFrameLabels(frame c:handle).
         
         FORM /*GUI*/ 
            pm_fr_list    colon 15
            pm_fr_min_wt  colon 15
            fr_um         no-label
            pm_fr_terms   colon 15
         with STREAM-IO /*GUI*/  frame d title color normal
            (getFrameTitle("CUSTOMER_FREIGHT_DATA",30)) side-labels
            width 88 attr-space.

         /* SET EXTERNAL LABELS */
         setFrameLabels(frame d:handle).

         FORM /*GUI*/ 
            pm_btb_type    colon 20
            pm_ship_lt     colon 55
            pm_btb_mthd    colon 20
            pm_btb_cr      colon 55
         with STREAM-IO /*GUI*/  frame e title color normal
            (getFrameTitle("ENTERPRISE_MATERIAL_TRANSFER_DATA",46))
            side-labels width 88 attr-space.

         /* SET EXTERNAL LABELS */
         setFrameLabels(frame e:handle).
*fdn 2004/12/24 *****************************************************************end*/

         {&rmpmrp01-P-TAG9}
         display pm_addr ad_name ad_line1 ad_line2 ad_line3 ad_city
            ad_state ad_zip ad_country
            ad_ctry
            ad_county
            ad_attn ad_phone ad_ext ad_attn2 ad_phone2 ad_ext2
            ad_fax ad_fax2 ad_date with frame a1 STREAM-IO /*GUI*/ .

         display pm_sort pm_type pm_region pm_slspsn[1]
            pm_slspsn[2]
            pm_ar_acct
            pm_ar_sub
            pm_ar_cc pm_resale pm_shipvia pm_rmks
            pm_pr_list
            ad_taxable  @ pm_taxable
            ad_taxc @ pm_taxc
            pm_partial pm_curr pm_lang
            pm_fix_pr
            pm_pr_list2
            pm_class pm_site
            pm_sic
         with frame b STREAM-IO /*GUI*/ .

/* fdn 2004/12/24 *****************************************************************begin*
         display pm_cr_limit pm_fin pm_high_cr pm_cr_terms pm_dun
            pm_stmt pm_stmt_cyc  pm_disc_pct pm_bill
            pm_high_date pm_db pm_cr_rating pm_pay_date pm_cr_hold
            pm_cr_review pm_cr_update
            pm_sale_date
            pm_po_req

         with frame c STREAM-IO /*GUI*/ .

         find fr_mstr where fr_list = pm_fr_list
            and fr_site = pm_site
            and fr_curr = pm_curr
         no-lock no-error.
         display pm_fr_list pm_fr_min_wt
            fr_um when (available fr_mstr)
            pm_fr_terms with frame d STREAM-IO /*GUI*/ .

         display pm_btb_type pm_ship_lt pm_btb_mthd pm_btb_cr
         with frame e STREAM-IO /*GUI*/ .

         /*DISPLAY ALL BANK ACCOUNTS FOR CUSTOMER */
         for each csbd_det where csbd_addr = pm_addr no-lock:
            /* GET MNEMONIC FOR ACCOUNT TYPE FROM lngd_det */
            {gplngn2a.i &file     = ""csbd_det""
               &field    = ""bk_acct_type""
               &code     = csbd_type
               &mnemonic = bk_acct_type
               &label    = bk_acct_type_desc}

            display csbd_bank
               bk_acct_type
               csbd_edi
               csbd_branch
               csbd_bk_acct
               csbd_beg_date
               csbd_end_date when (csbd_end_date <> hi_date)
               "" when (csbd_end_date = hi_date) @ csbd_end_date
            with frame csbd STREAM-IO /*GUI*/ .
            down 1 with frame csbd.
            /* ALLOW USER TO EXIT IF F4 PRESSED OR MAX LINE/PAGE REACHED */
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
         end. /* for each csbd_det where csbd_addr = pm_addr no-lock: */
*fdn 2004/12/24 **************************************************************** end */

         {&rmpmrp01-P-TAG10}
         
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/

      end. /* if (ad_zip >= zip and ad_zip <= zip1) then do: */
   end. /* for each pm_mstr */
   
   
   /* REPORT TRAILER  */

   
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


end. /* repeat: */

{wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" code code1 name name1 zip zip1 type type1 region region1 slspsn slspsn1 "} /*Drive the Report*/
